


#ifndef MPI_SAMPLE_VENC_H
#define MPI_SAMPLE_VENC_H

#include "mpi_lib.h"
#include "sample_sys.h"
#include "sample_vin.h"
#include "mdi_common.h"
#include "mpi_version.h"

#ifdef  __cplusplus
extern "C"
{
#endif

typedef enum __venc_test_mode
{
	SENSOR_DATA_ENCODE_TEST = 1,
	YUV_DATA_H264_ENCODE_TEST,
	YUV_DATA_MJPEG_ENCODE_TEST,
	START_STOP_PRESSURE_TEST,	
}venc_test_mode_e;


typedef enum __sgks_stream_type
{
	stmNone = 0,
	stmAudio,
	stmVideo
}sgks_stream_type_e;

struct inparam
{
    unsigned int argc;
    unsigned char argv[20][100];
};

typedef enum __sgks_video_ecode_type
{
	vtNone = 0,
	vtH264,
	vtMJPEG 
}sgks_video_ecode_type_t;

typedef enum __venc_stream_state
{
    VENC_STREAM_STATE_UNKNOWN              = 0,    // uninitialized or unconfigured
    VENC_STREAM_STATE_READY_FOR_ENCODING   = 1,    // configured ready, but not started encoding yet
    VENC_STREAM_STATE_ENCODING             = 2,    // encoding
    VENC_STREAM_STATE_STARTING             = 3,    // transition state: starting to encode
    VENC_STREAM_STATE_STOPPING             = 4,    // transition state: stopping encoding
    VENC_STREAM_STATE_ERROR                = 255,  // known error
}venc_stream_state_e;


typedef struct __video_encode_stream
{
    sgks_mpi_venc_stream_format_param_s streamFormat;
    sgks_mpi_venc_h264_config_s   h264Conf;
    sgks_mpi_venc_mjpeg_config_s  mjpegConf;
}video_encode_stream_s;

typedef struct __frame_head
{
    unsigned char ch;
    unsigned char resolution;  
    unsigned char frame_type;    /* 1: i frame 2:p frame 3:audio*/
    unsigned char frame_rate;    
    unsigned long frame_size;    
    unsigned long sec;
    unsigned long usec;
    int  frame_no;
    char reserve[4];
} frame_head_s;

typedef struct __sgks_encode_steram
{
    sgks_stream_type_e stType;
    unsigned char nChannel;
    sgks_video_ecode_type_t vetEncodeType;
    unsigned char nFrameType;
    unsigned int FrameNumber;
    unsigned int nSize;
    unsigned long long nTimeStamp;	 
    unsigned char *pData;
}sgks_encode_stream_s;

int sgks_mpi_xc9080_sample_venc_setting(int venc_test_mode);
int sgks_mpi_xc9080_sample_venc_start(void);
int sgks_mpi_xc9080_sample_venc_stop();
int sgks_mpi_xc9080_sample_venc_test(int venc_test_mode);
int sgks_mpi_xc9080_sample_venc_setting(int venc_test_mode);
#ifdef  __cplusplus
}
#endif

#endif



